<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::t('system', 'app name')."-".Yii::t('system', 'description');?></title> 
<link href="<?php echo Yii::app()->request->baseUrl; ?>/public/bt/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/public/css/<?php echo Yii::app()->language; ?>_admin.css"  rel="stylesheet" />
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/public/js/jquery-1.8.3.min.js"></script>
<!-- artdialog start-->
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/public/js/art_dialog/artDialog.source.js?skin=wzcms"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/public/js/art_dialog/plugins/iframeTools.source.js" ></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/public/js/art_dialog/_doc/highlight/highlight.pack.js"  ></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/public/js/art_dialog/_doc/highlight/languages/javascript.js" ></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/public/js/admin.js"></script>

<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/public/font/css/font-awesome.css">
<!--[if IE 7]>
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/public/font/css/font-awesome-ie7.min.css">
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/public/font/css/font-awesome-ie7.css">
<![endif]-->

</head>

<body style="overflow:hidden;">
<div id="dvLockScreen" class="ScreenLock" style="display:none">
    <div id="dvLockScreenWin" class="inputpwd">
    <h5><b class="ico ico-info"></b><span id="lock_tips"><?php echo Yii::t('admin','lock_inits');?></span></h5>
    <div class="input">
    	<label class="lb"><?php echo Yii::t('admin','lock_password');?></label><input type="password" id="lock_password" class="input-text" size="24">
        <input type="submit" class="submit" value="&nbsp;" name="dosubmit" onclick="check_screenlock();return false;">
    </div></div>
</div>
<div style="display: block;" class="scroll"><a href="javascript:;" class="per" title="<?php echo  Yii::t('admin','using the mouse wheel scrolling sidebar');?>" onclick="menuScroll(1);"></a><a href="javascript:;" class="next" title="<?php echo  Yii::t('admin','using the mouse wheel scrolling sidebar');?>" onclick="menuScroll(2);"></a></div>
<div class="top">
	<div class="admin_logo">
		<img src="<?php echo Yii::app()->request->baseUrl; ?>/public/images/admin_img/admin_logo.png">
	</div>
	<div style="float:left">
	<div align="center" style="width: 694px;float:left;height:20px;line-height:30px;"></div>
	<div  style="height:20px;line-height:30px;float:right" >
	<?php echo Yii::t('admin','welcome').Yii::app()->session['role_name'];?> <?php echo Yii::app()->session['admin_real_name'];?> | <a href="<?php echo Yii::app()->createUrl('admin/system/changepassword');?>"  onclick="$('#crumbs').html('<?php echo Yii::t('resource','my_panel');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','personal_info');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','change_password');?>');"target="main"><?php echo Yii::t('resource','change_password');?></a> | <a href="<?php echo Yii::app()->createUrl('admin/default/logout');?>" ><?php echo Yii::t('admin','logout');?></a>
	</div>
	<div class="top_nav"   >
			<ul class="nav" style="position: relative" >
				<?php 
				    $morestr ='<li class="dropdown "> 
   		                 <a  href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="loadmore()"  id="nav_li_more" class="selected"><i style="font-size:16px;" class="icon-plus-sign-alt"><span style="font-size:13px;">&nbsp;更多</span></i><span class="caret"></span></a>
		                 <ul class="dropdown-menu" role="menu">
		              ';
				    $navstr ="";
				for($i=0;$i<count($top_menus);$i++){
                        $name= Yii::t('resource',$top_menus[$i]->name);
                        $icon = $top_menus[$i]->icon;
					if($i<=10){
					    $nav .= '<li class="meli" ><a href="javascript:void(0)" onclick="loadLeftMenu('.$top_menus[$i]->resource_id.',\''.Yii::app()->createUrl("".$top_menus[$i]->module."/".$top_menus[$i]->controller."/".$top_menus[$i]->action."").'\');" id=\'nav_li_'.$top_menus[$i]->resource_id.'\'  >'.$name.'</a>  </li>';
	               }else{
                        if(!$icon) $icon="icon-magic";
                        $navstr .= '<li ><a class="tl" href="javascript:void(0)" onclick="loadLeftMenu('.$top_menus[$i]->resource_id.',\''.Yii::app()->createUrl("".$top_menus[$i]->module."/".$top_menus[$i]->controller."/".$top_menus[$i]->action."").'\',\'1\');" id=\'nav_li_'.$top_menus[$i]->resource_id.'\'  ><i class="'.$icon.'"></i>&nbsp;'.$name.'</a></li>';
                    }
                }
 				if($navstr) $nav .=$morestr.$navstr."</ul></li>"; 
 				echo $nav;
				?>
			</ul>		

			<!-- <li class="dropdown ">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">更多频道 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
          </ul>
        </li> -->
	</div>
	</div>
	<div class="top_member" style="display:none"  >
	<?php echo Yii::t('admin','welcome').Yii::app()->session['role_name'];?> <?php echo Yii::app()->session['admin_real_name'];?> | <a href="<?php echo Yii::app()->createUrl('admin/system/changepassword');?>"  onclick="$('#crumbs').html('<?php echo Yii::t('resource','my_panel');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','personal_info');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','change_password');?>');"target="main"><?php echo Yii::t('resource','change_password');?></a>
	</div>
</div>
<div class="side_switch" id="side_switch">
</div>
<div class="side_switchl" id="side_switchl">
</div>
<div id='main_content' >
	<div class="left" style="float:left;">
		<div class="member_info" style="display:none">
				<div class="member_ico" > <a  onclick="$('#crumbs').html('<?php echo Yii::t('resource','my_panel');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','personal_info');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','account_setting');?>');" href="<?php echo Yii::app()->createUrl('admin/system/accountsetting');?>" target="main"><img src="<?php echo Yii::app()->request->baseUrl; ?>/public/images/admin_img/nophoto.gif" width="43" height="43" ></a></div>	             <a class="system_a" onclick="$('#crumbs').html('<?php echo Yii::t('resource','my_panel');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','personal_info');?>&nbsp;>&nbsp;<?php echo Yii::t('resource','account_setting');?>');" href="<?php echo Yii::app()->createUrl('admin/system/accountsetting');?>" target="main"><?php  echo Yii::t('resource','account_setting');?></a><a href="<?php echo Yii::app()->createUrl('admin/default/logout');?>" class="system_logout"><?php echo Yii::t('admin','logout');?></a>
		</div>
		<div id="scroll">
			<div id='left_main'>		

			</div>
		</div>
	</div>

	<div class="right"  style="float:left">
		<div class="top_subnav" id='crumbs'></div>
		<IFRAME id="right_main" style="margin:0px;padding:0px;" marginheight="0" name="main" src="<?php echo Yii::app()->createUrl('admin/system/starts/');?>" frameBorder=0 width="100%" scrolling="auto"  height="auto" allowtransparency="true"></IFRAME>
	</div>
</div>
<script language="javascript">
if(!Array.prototype.map)
Array.prototype.map = function(fn,scope) {
  var result = [],ri = 0;
  for (var i = 0,n = this.length; i < n; i++){
	if(i in this){
	  result[ri++]  = fn.call(scope ,this[i],i,this);
	}
  }
return result;
};

var getWindowSize = function(){
return ["Height","Width"].map(function(name){
  return window["inner"+name] ||
	document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
});
}
window.onload = function (){
	if(!+"\v1" && !document.querySelector) { // for IE6 IE7
	  document.body.onresize = resize;
	} else { 
	  window.onresize = resize;
	}
	function resize() {
		wSize();
		return false;
	}
}

function wSize(){
	//这是一字符串
	var str=getWindowSize();
	var strs= new Array(); //定义一数组
	strs=str.toString().split(","); //字符分割
	var heights = strs[0]-123,Body = $('body');$('#main_content').height(strs[0]);$('#right_main').height(heights);$("#scroll").height(heights);
	if(strs[1]<980){
		$('#main_content').css('width',980+'px');
		Body.attr('scroll','');
		Body.removeClass('no_scroll');
	}else{
		$('#main_content').css('width','auto');
		Body.attr('scroll','no');
		Body.addClass('no_scroll');
	}

	var widths = $('.top').width();
	if($('.left').css('display')=='none')
	{
		var right_body_height = $("#right_main").contents().find(".right_body").css('height');
		right_body_height = right_body_height.replace('px','');
		
		if(parseInt(right_body_height)>heights)
		{
			$('.right').width((widths-9)+'px');
		}
		else
		{
			$('.right').width((widths)+'px');
		}
		$('.right').css('margin-left','9px');
	}
	else
	{
		$('.right').width((widths-205)+'px');
		$('.right').css('margin-left','0px');
	}
}

wSize();
function windowW(){
	$(".scroll").show();
}
windowW();
function loadmore(){
	$(".selected").removeClass('selected');
	$("#nav_li_more").addClass('selected');
	$(".oa_set").show();
}
//加载左侧菜单
function loadLeftMenu(resource_id,target_url,$type)
{
    $(".dropdown-menu").hide();	
	$.get("<?php echo Yii::app()->createUrl('admin/default/leftmenu/');?>", {parent_id:resource_id}, function(data){
	    $('#left_main').html(data);
		windowW();
 	}); 
    if($type!=1){
	$(".selected").removeClass('selected');
	$("#nav_li_"+resource_id+"").addClass('selected');
    }
}

loadLeftMenu(1,'<?php echo Yii::app()->createUrl('admin/system/start');?>');
//左侧二级菜单缩放
function switch_show(menu_id,ul_id)
{
	var obj = $("#"+menu_id);
	if(obj.attr('class')=='left_title_up')//收起
	{
		obj.removeClass('left_title_up');
		obj.addClass('left_title');
		$('#'+ul_id).hide();
	}
	else//打开
	{
		obj.removeClass('left_title');
		obj.addClass('left_title_up');
		$('#'+ul_id).show();
	}
}

//添加左侧滚动事件监听
(function(){
    var addEvent = (function(){
             if (window.addEventListener) {
                return function(el, sType, fn, capture) {
                    el.addEventListener(sType, fn, (capture));
                };
            } else if (window.attachEvent) {
                return function(el, sType, fn, capture) {
                    el.attachEvent("on" + sType, fn);
                };
            } else {
                return function(){};
            }
        })(),
    Scroll = document.getElementById('scroll');
    // IE6/IE7/IE8/Opera 10+/Safari5+
    addEvent(Scroll, 'mousewheel', function(event){
        event = window.event || event ;  
		if(event.wheelDelta <= 0 || event.detail > 0) {
				Scroll.scrollTop = Scroll.scrollTop + 29;
			} else {
				Scroll.scrollTop = Scroll.scrollTop - 29;
		}
    }, false); 

    // Firefox 3.5+
    addEvent(Scroll, 'DOMMouseScroll',  function(event){
        event = window.event || event ;
		if(event.wheelDelta <= 0 || event.detail > 0) {
				Scroll.scrollTop = Scroll.scrollTop + 29;
			} else {
				Scroll.scrollTop = Scroll.scrollTop - 29;
		}
    }, false);
})();

function menuScroll(num){
	var Scroll = document.getElementById('scroll');
	if(num==1){
		Scroll.scrollTop = Scroll.scrollTop - 60;
	}else{
		Scroll.scrollTop = Scroll.scrollTop + 60;
	}
}

$(function(){
	$("#side_switch").click(function(){
		$(".left").hide();
		$(".scroll").hide();
		$('#crumbs').removeClass('top_subnav');
		$('#crumbs').addClass('top_subnav_hide');
		$('.top_member').css('text-indent','10px');
		$(this).hide();
		$("#side_switchl").show();
		$("#right_main").contents().find(".right_body").css('margin-right',14);
		
		wSize();
	})
})

$(function(){
	$("#side_switchl").click(function(){
		$(".left").show();
		$(".scroll").show();
		$('#crumbs').addClass('top_subnav');
		$('#crumbs').removeClass('top_subnav_hide');
		$('.top_member').css('text-indent','65px');
		$(this).hide();
		$("#side_switch").show();
		$("#right_main").contents().find(".right_body").css('margin-right',5);
		$("#right_main").contents().find(".right_body").css('margin-left',5);
		wSize();
	})
})

$(".dropdown-toggle ").click(
function (){
	$(".dropdown-menu").slideToggle();
	}
)
$(".dropdown-menu li").click(function (){
    $(".dropdown-menu li").attr("class","");
    $(this).attr("class","clc");
})
</script> 
<style>
	.top_nav a.tl{text-align:left;}
	.top_nav a.tl i,.dropdown-menu>li>a{color:#585858;}
	.dropdown-menu .clc a{   color:#fff;}
	.dropdown-menu .clc a i {   color:#fff;}
	.dropdown-menu .clc a:hover i {   color:#000;}
	.dropdown-menu .clc{background:#428bca;}
	.dropdown-menu .clc{background:#428bca;}
	.dropdown-menu li:hover{background:#1963aa;}
	a:hover{text-decoration:none}
</style>
</body>
</html>